#include <algorithm>
#include <stddef.h>
#include <iostream>
//#include <ostream>
#include <vector>
using namespace std;

int main()
{
	/*
	vector<int> v;
	v.push_back(11);
	v.push_back(22);
	v.push_back(33);
	
	cout << v.size() << endl;

	// Get item value.
	vector<int>::iterator i = v.begin() + 1;
	cout << *i << endl;

	// Modify existed vector item value.
	v[2] = 44;
	
	// Enumerate all the vector items.
	for (size_t i = 0; i < v.size(); ++i)
	{
		cout << v[i] << endl;
	}
	// Or enumerate like this:
	for (vector<int>::iterator i = v.begin(); i != v.end(); ++i)
	{
		cout << *i << endl;
	}
	// Or like this:
	for (auto i = v.begin(); i != v.end(); ++i)
	{
		cout << *i << endl;
	}

	v.clear();
	*/

	/*

	vector<int> v2;
	v2.push_back(33);
	v2.push_back(11);
	v2.push_back(55);
	v2.push_back(22);
	v2.push_back(44);

	for (auto i = v2.begin(); i != v2.end(); ++i)
	{
		cout << *i << endl;
	}

	sort(v2.begin(), v2.end());
	cout << "After sorting..." << endl;

	for (auto i = v2.begin(); i != v2.end(); ++i)
	{
		cout << *i << endl;
	}

	v2.clear();

	*/

	vector<int> v3;
	v3.push_back(11);
	v3.push_back(22);
	v3.push_back(33);
	v3.push_back(44);
	v3.push_back(55);
	v3.push_back(66);

	for (auto i = v3.begin(); i != v3.end(); ++i)
	{
		cout << *i << endl;
	}

	v3.erase(remove_if(v3.begin(), v3.end(),
		[] (int e){ return e % 2 != 0; }), v3.end());

	
	for (auto i = v3.begin(); i != v3.end(); ++i)
	{
		cout << *i << endl;
	}
}